import { Injectable } from '@angular/core';
import { Resolve, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
import { TaskService } from 'app/modules/task/services/task.service';

@Injectable({
  providedIn: 'root',
})
export class ClientMessageDetailService implements Resolve<any> {
  constructor(private taskService: TaskService) {}
  resolve(route: ActivatedRouteSnapshot) {
    const id = Number(route.queryParamMap.get('id'));
    return this.taskService.get(id);
  }
}
